package com.gxa.common;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.stereotype.Component;

@ApiModel("返回对象")
@Component
public class R<T>{
    @ApiModelProperty(name = "code",notes = "状态码",dataType = "Integer",required = false)
    private Integer code;
    @ApiModelProperty(name = "msg",notes = "返回消息,失败为FAILED，成功为SUCCESS",dataType = "String",required = false)
    private String msg;
    @ApiModelProperty(name = "data",notes = "返回数据",dataType = "Object",required = false)
    private T data;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return "R{" +
                "code=" + code +
                ", msg='" + msg + '\'' +
                ", data=" + data +
                '}';
    }
}